import time

from selenium import webdriver
from selenium.webdriver.common.by import By



class case:
    def __init__(self):
        self.driver = webdriver.Chrome()
    def so(self):
        self.driver.get('https://www.sogou.com/')
        self.driver.find_element(By.ID, 'query').send_keys('天气预报')
        self.driver.find_element(By.ID, 'stb').click()
        time.sleep(2)
        print(self.driver.title)
        if '天气预报' in self.driver.title:
            print('找到了')
        else:
            print('没找到')
    def quit(self):
        self.driver.quit()

if __name__ == '__main__':
    case1 = case()
    case1.so()
    time.sleep(2)
    case1.quit()




